*****************************************************************
*********** Mining and violent competition in Africa ************
****** A.S. Rigterink, T. Ghani, J.S. Lozano, J.N. Shapiro ******
*****************************************************************

------------------------
-- Stata version used --
------------------------

Stata/SE 17.0 for Windows (64-bit x86-64)

---------------------
-- Packages needed --
---------------------

reghdfe 
reg2hdfe
texsave

These are installed when running do-file "0-Master.do"

Also required are:
my_reg2hdfespatial by T. Fetzer (2014) 
my_ols_spatial_HAC by S. Hsiang (2010)

These are included in the folder "Do".

Fetzer, T. (2014) "Can Workfare Programs Moderate Violence? Evidence from India", STICERD Working Paper. 
Hsiang, S. M. (2010). Temperatures and cyclones strongly associated with economic production in the Caribbean and Central America. PNAS, 107(35), 15367–72.

----------------------------
-- Setting your directory --
----------------------------

In order to run the do-files, you must change the directory to the 
directory where you stored the folder "Stata" on your computer. 

For 0-Master.do, you must change this where it says:
*** NB: SET YOUR DIRECTORY HERE 

If running individual do-files, you must change this where it says:
*** NB: SET YOUR DIRECTORY HERE AND UNTEXT IF NOT RUNNING 0-Master.do
AND you must untext (i.e. remove the asterisks before ) the lines starting with:
"global dir" and "cd"

-------------------------------------------------------
-- What do-files replicate which Tables and Figures? --
-------------------------------------------------------

Running do-file "0-Master.do" replicates:

* Main text: 
** Table 2
** Table 3
** Table 4
** Table 5

* Appendix:
* Table A1, A2, A3 and A4
* Figure A3, A4 and A9
* All Tables and Figures in Section B
* All Tables and Figures in Section C
* All Tables and Figures in Section D

Other Tables and Figures are replicated using material in the folder "R"

When replicating Tables and Figures individually:

Do-files named "Main_[...]" and "Appendix_[...]" replicate the 
ANALYSIS needed to replicate the Tables and Figures mentioned 
in the file title. Most of these do-files store results to the 
folder "Results", and do not generate the table or figure itself.

If not generated by the Do-files named "Main_[...]" and "Appendix_[...]", 
the TABLE and or FIGURE itself is replicated by running Do-file 
"All_Tables_Figures_Generate". The figure or table will be stored 
in the folger "Figures" or "Tables" repectively. 

Appendix Figure B1 and Tables B1 and B2 (summary statistics) involve no analysis. 
They are replicated by running Do-file "All_Tables_Figures_Generate".

------------------------
-- Data and copyright --
------------------------

Folder "Data" contains all data needed to run all do-files.

All data on industrial mines: 
Copyright © 201*, S&P Global Market Intelligence (and its affiliates, as applicable)
